FROM {{ namespace }}/{{ image_prefix }}prometheus-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% import "macros.j2" as macros with context %}

{% block prometheus_libvirt_exporter_header %}{% endblock %}

{{ macros.install_packages(prometheus_libvirt_exporter_packages | customizable("packages")) }}

{% block prometheus_libvirt_exporter_install %}
ADD prometheus-libvirt-exporter-archive /prometheus-libvirt-exporter-source

RUN ln -s /prometheus-libvirt-exporter-source/* prometheus-libvirt-exporter \
    && cp /prometheus-libvirt-exporter/prometheus-libvirt-exporter /opt/libvirt-exporter

{% endblock %}

{% block prometheus_libvirt_exporter_footer %}{% endblock %}
{% block footer %}{% endblock %}

USER root
